UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jW7U7yCvvVwxShxi5o7fifyFMA1XAvhTWcHHwi70Umc=' 
WHERE 
  key_id = '82253951211e10fa091524efda63671e2b724331a47f62f6bd58d5293034f378' 
  AND (
    token = 'jW7U7yCvvVwxShxi5o7fifyFMA1XAvhTWcHHwi70Umc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022