UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qXc8vH9lyJ/NopGQo+nkWqTcw3eViCSpF0cMS8mLuq8='
WHERE
key_id = '824137b3a49d2a6b5e096ef29cd6a701050e3961a6b16467bb7ba7756bfa3c68'
AND (
token = 'qXc8vH9lyJ/NopGQo+nkWqTcw3eViCSpF0cMS8mLuq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)