UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z93knvy6EIHiPXVnE/ovNfJEtf/oB5/eqq8iSmbxoMA='
WHERE
key_id = 'b4bf68eb38cb1e292640b3931784dbd60e0ccb6e731404029b13728a6c5916b3'
AND (
token = 'z93knvy6EIHiPXVnE/ovNfJEtf/oB5/eqq8iSmbxoMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)