UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RIpvp5oMhs5nqBtd6U+E8iTOEKUGPwDwQm/J/pJXNXE='
WHERE
key_id = '42760f2262d10672c7b26e97d9609443c1ac10a482ab1b90d088ef1fd272e6d9'
AND (
token = 'RIpvp5oMhs5nqBtd6U+E8iTOEKUGPwDwQm/J/pJXNXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)