UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wVoXfsp87lcdiDe9R5vfX04pZ8cfzGGHCbsYicveTP8='
WHERE
key_id = '59b8294da3be7ddec61b2047ea8ef363d0e2a0784a7de928c8f412ec46323bb9'
AND (
token = 'wVoXfsp87lcdiDe9R5vfX04pZ8cfzGGHCbsYicveTP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)