UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i+Y7AWTTuFyOMXOfgjNYX1kHF6KNQkkgVtU18ByZzcE='
WHERE
key_id = '0c7f3191423ff33b53954de338f6a147b13702cb8d282e9021ac310cc94ab76e'
AND (
token = 'i+Y7AWTTuFyOMXOfgjNYX1kHF6KNQkkgVtU18ByZzcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)