UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QBx7bxvAiNRPyegC/zkx9FIZU23tZkw+UYVdpihY5nY='
WHERE
key_id = 'dd6f39a825e9d68787ca2f1f3e865ba9a711c70dc2beec121b379bcdaf0c26e8'
AND (
token = 'QBx7bxvAiNRPyegC/zkx9FIZU23tZkw+UYVdpihY5nY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)