UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ndtmgZXI9jGcjih+zYIJQ/jnEg84AJ+cXmSnzJ/K4sE='
WHERE
key_id = 'c53111059e9cdfc13d83ad597d0179d1afff6e22074e7b5c827132d941253adb'
AND (
token = 'ndtmgZXI9jGcjih+zYIJQ/jnEg84AJ+cXmSnzJ/K4sE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)