UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/pNPmLICx3fd37FZFu+9fITFchNjpX6gnV6sSYaHt0w=' 
WHERE 
  key_id = '9011b84b53880bb2ec0e4bb7dc8925c41c57d3130f1eac45864ee17117435548' 
  AND (
    token = '/pNPmLICx3fd37FZFu+9fITFchNjpX6gnV6sSYaHt0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031