UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qgy9xC9xBCp4yLH1C0IDfbA2f3c6SYMK6viYkd90Xtw='
WHERE
key_id = '026249a0c5c2a40d3e827e7673bd3c30b64b3fb5d8c09f38c8eeda7389a8db81'
AND (
token = 'Qgy9xC9xBCp4yLH1C0IDfbA2f3c6SYMK6viYkd90Xtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)