UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'houWEq30ird0LtZdOmwV2+zjuZdbp6P5Ts/vpQoGOJg=' 
WHERE 
  key_id = '7c1dfca0432610ddb3ae2a5500d5139be92b655df6788c4f13a7788f1d72a52e' 
  AND (
    token = 'houWEq30ird0LtZdOmwV2+zjuZdbp6P5Ts/vpQoGOJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035