UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '48Irnlp2Kjy2ALBXayytfMv5juzXYAtUm7u65/Xxcg4='
WHERE
key_id = '2b0884a154154041ebeaebd5b0f54b34f04c66a31880fa7481442cfc8f8610e0'
AND (
token = '48Irnlp2Kjy2ALBXayytfMv5juzXYAtUm7u65/Xxcg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)