UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qkKEXDuLiDn/2mzmdxFQ7kIB2sVzoCRMhzJFzFLAKMc=' 
WHERE 
  key_id = '824739a2f6cb97da678d159d39f95699fd793db4a54ba4e54e940540199a55d4' 
  AND (
    token = 'qkKEXDuLiDn/2mzmdxFQ7kIB2sVzoCRMhzJFzFLAKMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055