UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9mUTWhjzre954PXvdVACP+ldXf9+4OvqC2xlYTFVdpc=' 
WHERE 
  key_id = '7e72f0c18a88edd134c3339125fc96692aa504646c9efeaf552e4e9bfde31f2f' 
  AND (
    token = '9mUTWhjzre954PXvdVACP+ldXf9+4OvqC2xlYTFVdpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033