UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WxVOtKr9zVoXZ6dyI5OMSQbOXEhYxJ7UVvvDdxHmrHg='
WHERE
key_id = 'fbb95c6f479216da0c8d5169181f6122bf81a334832a030ded3d353d2137166b'
AND (
token = 'WxVOtKr9zVoXZ6dyI5OMSQbOXEhYxJ7UVvvDdxHmrHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)