UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lEML3hvQey8Xrnje7nL5DximIclEVn631fLg+fjl5/w='
WHERE
key_id = 'e6abb68b3d113bdff73345914a351c0ef9cc027325aaf0a7e8697933e3a3692d'
AND (
token = 'lEML3hvQey8Xrnje7nL5DximIclEVn631fLg+fjl5/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)