UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eu1Jk5DVyQthTyt+JnuFOzYiJEjmCDb94uUmer0gdi8='
WHERE
key_id = 'b1a1d6bf976b604f2823e2d3b4ca9e49bc3dd5ce6cfdc271a54910bcf353dbe5'
AND (
token = 'eu1Jk5DVyQthTyt+JnuFOzYiJEjmCDb94uUmer0gdi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)