UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'srI44j5tcy8qn+QwmO68e9P6o4opzElyQ9JVni6GuTY='
WHERE
key_id = 'd59d30098549547f5ab3412a4811c8c11d67dfa23dbd352ee727068030074bff'
AND (
token = 'srI44j5tcy8qn+QwmO68e9P6o4opzElyQ9JVni6GuTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)