UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MQCiBiyYXAVE1RPiDO6cL6bV5ux/iEnnu3wuN4upXq0=' 
WHERE 
  key_id = 'b48da98fdec6f0758d0d66212a0e8d6a5802f981ac232b6fc5eddedbc3e19522' 
  AND (
    token = 'MQCiBiyYXAVE1RPiDO6cL6bV5ux/iEnnu3wuN4upXq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022