UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yQoYedH7GdYx+VMxkfjcrKYzHl6mtcG9rHgBUin8ovI=' 
WHERE 
  key_id = 'a685333b9f352d6d2e406307fb51e05e4fdd1a3778c9bacf70e31fc4583bd603' 
  AND (
    token = 'yQoYedH7GdYx+VMxkfjcrKYzHl6mtcG9rHgBUin8ovI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022