UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y0rOOiIn3cAPxddoDZnb7l75zUIvy2GLe65OT4I9+/I=' 
WHERE 
  key_id = '1d4f826f6995744ef30e04f63f611498804932f9bedd04328f78341786d13dfe' 
  AND (
    token = 'y0rOOiIn3cAPxddoDZnb7l75zUIvy2GLe65OT4I9+/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022