UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gM4x84KqzJD9xwR9/Bd5O51M9FRIGiwQAcBb1054hj8=' 
WHERE 
  key_id = '4edfbe4a2a6d9657d8af359e1f573e136390da5122069bf0ed0f9ea29c0ed265' 
  AND (
    token = 'gM4x84KqzJD9xwR9/Bd5O51M9FRIGiwQAcBb1054hj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029