UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmf3TdAwQsxKeMs+OHtbTrKWCQ7l7Vz4NK67DagPtuU='
WHERE
key_id = '6558aee7572e22da0443258693eeeadf90a73139e93af644075d7147e2e20d0b'
AND (
token = 'qmf3TdAwQsxKeMs+OHtbTrKWCQ7l7Vz4NK67DagPtuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)