UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sGZXZWEkmjGnx7v0oB/kaAtpV01AzVtIfHNC5ocBqek='
WHERE
key_id = 'c79953431c48b8f956e515e85be95c273f69290c04f83c45b4a35a1f0172eb44'
AND (
token = 'sGZXZWEkmjGnx7v0oB/kaAtpV01AzVtIfHNC5ocBqek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)