UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'afjRihKO3JDVMD4ETOR2fUAzvKYhTSoBWxQY00pcO/g='
WHERE
key_id = 'ff86bf67e06d4874f4ace1e0f6f7d21ee053fb7d17a949dc9e7d96afe0f1ee56'
AND (
token = 'afjRihKO3JDVMD4ETOR2fUAzvKYhTSoBWxQY00pcO/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)