UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4oyD32VkWljxxQj78gb/UeI8f67xH7WorI4NkuYTeHM=' 
WHERE 
  key_id = '101a834e8ba675889b6ce41acbfa0b79091b235643eead68063ad1a369263b5d' 
  AND (
    token = '4oyD32VkWljxxQj78gb/UeI8f67xH7WorI4NkuYTeHM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037