UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wd8xBDJKF00ajqDO6XLtYLCRdHJSyMVGH3GUvJYjZnw='
WHERE
key_id = '5015580a39b9fff5a8a0fb1ce6a0af1f35000ac31c40a7b0b93a3c5d80e5147c'
AND (
token = 'Wd8xBDJKF00ajqDO6XLtYLCRdHJSyMVGH3GUvJYjZnw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)