UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eVZbh2pZFScdShmK6JVW6o0rm1CpkojxTDszM7Igxrs='
WHERE
key_id = '3f2ad1aa337b7877f48f4a08d8cf8f718e50e1e16d1e73dc2f9257bf5a64776a'
AND (
token = 'eVZbh2pZFScdShmK6JVW6o0rm1CpkojxTDszM7Igxrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)