UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4IbNafcLd1cpxNS1LKwHmTkNTQdzPKykB4t+2GBDJ74='
WHERE
key_id = 'fe0354a902717618732a379ec2df267ae2f05776a2b51290e4ffda37651c53aa'
AND (
token = '4IbNafcLd1cpxNS1LKwHmTkNTQdzPKykB4t+2GBDJ74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)