UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iwK0U0QRNFQCn4EU24y+yDV/TRWdYe2N0Q0j+0VFz3s='
WHERE
key_id = 'dae2925ca505fe608df87614e43250741f44951b8489bee1bf51df2db03c80da'
AND (
token = 'iwK0U0QRNFQCn4EU24y+yDV/TRWdYe2N0Q0j+0VFz3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)