UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mmml5u/OVXiI/Dqlajh0lhE8HM9soe4a7ycX2vXGtvw='
WHERE
key_id = '0b978c30265b8f00b525c853466c23ac7f363356f301c5f5ec2cfb175185018a'
AND (
token = 'Mmml5u/OVXiI/Dqlajh0lhE8HM9soe4a7ycX2vXGtvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)