UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wmrXJHBHkxt2oIcBDTSQzE/yfd7g7khQSEMAALlR7io='
WHERE
key_id = '216ccaa36296df72859c54be5e60bf6802a19cc5fe15ae778d4a5bb3f12ade86'
AND (
token = 'wmrXJHBHkxt2oIcBDTSQzE/yfd7g7khQSEMAALlR7io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)