UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o0/RQnxFRg/HCWvxt2Z6hNNCiFGsVzbhOxu5PAYAXJo='
WHERE
key_id = '6d9c1e3a2a816d415e2394d442558b8dac8a170ae57ad69949ed75ddaee1c4ac'
AND (
token = 'o0/RQnxFRg/HCWvxt2Z6hNNCiFGsVzbhOxu5PAYAXJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)