UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c6q6XU0rJNwtFuTqPuCKp6QvJ35KRZrU8UP2ymuvxRg='
WHERE
key_id = 'ce02f9d7501bdccd7acd3f39bd1fae40a7a0fda17ad9b1d4cd1ec5102bf0f049'
AND (
token = 'c6q6XU0rJNwtFuTqPuCKp6QvJ35KRZrU8UP2ymuvxRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)