UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kaz0FcqL17KdgVaPlnnstp1X6gnTUD9IKx0VnQ3BXvE=' 
WHERE 
  key_id = '6203be9fc4d21c6706ea67084d634a19bd9122979fc1033e4c9a79515c6590ed' 
  AND (
    token = 'kaz0FcqL17KdgVaPlnnstp1X6gnTUD9IKx0VnQ3BXvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042