UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MpI3omWA//f1URCFITwGchiPoNub9tHEFF7z9+viC2Q=' 
WHERE 
  key_id = '634df844364305516fe87dce1f94bbb1c8a95dd24281bb48617131f7e5743439' 
  AND (
    token = 'MpI3omWA//f1URCFITwGchiPoNub9tHEFF7z9+viC2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040