UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QdXW8n159YnKKo7LPvOLRSRAWFeA+z1xH3/2ef655kU='
WHERE
key_id = '1eeaf919dbef3c576712a6997d20c86e71551cbed051850de83d79811615fbe4'
AND (
token = 'QdXW8n159YnKKo7LPvOLRSRAWFeA+z1xH3/2ef655kU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)