UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7cUeMYj5telAe4FjEonlFlLlIfZBqX+g1dP0pclrg94=' 
WHERE 
  key_id = '928db2321553c110c5d35f9dcc4c857ed2d18913f60ec234909890f48496b0da' 
  AND (
    token = '7cUeMYj5telAe4FjEonlFlLlIfZBqX+g1dP0pclrg94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035