UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bxJNUUuRcebF7jcTn641R0vpJR4Ydn05jMNMZlExz5s=' 
WHERE 
  key_id = '0311469adae7e2a57d19e55de7a29cabde6a41ec960d5193c2d9bcf0fdb843b8' 
  AND (
    token = 'bxJNUUuRcebF7jcTn641R0vpJR4Ydn05jMNMZlExz5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038