UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rsEFDAX5qF1Fo5XtMxPbVWAdb0X2U27cI66zxW+an0M=' 
WHERE 
  key_id = '633e1da3d08b1d4bf08f8eb82412a32d076d375cc39ed6e3771cb4451b3049b5' 
  AND (
    token = 'rsEFDAX5qF1Fo5XtMxPbVWAdb0X2U27cI66zxW+an0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043