UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8O/2REUQVfiwk+XVLNsNdUmmfYvxy6FcS4q8N840SdQ='
WHERE
key_id = 'c86a9d6e321b54d9c071a8f8608e52baf144163312ec28ab6faad76377ab6f18'
AND (
token = '8O/2REUQVfiwk+XVLNsNdUmmfYvxy6FcS4q8N840SdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)