UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QV96qmPc7Xww92oR5QKh+w//FOTbCu10sPRCGdSEj+w=' 
WHERE 
  key_id = '270bb4f510247e15c3dfff6e2cc7440e1ba48fc5d99f49d87e7ac1d570dad84c' 
  AND (
    token = 'QV96qmPc7Xww92oR5QKh+w//FOTbCu10sPRCGdSEj+w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053