UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Os+1DlsZalnFkt9hvUESnZvlNrDMPhSJ08jIvYKhxKo=' 
WHERE 
  key_id = 'da82061efc920ada7e9e69434a4de11cb68a7ec9603798376f3accc30f6fc468' 
  AND (
    token = 'Os+1DlsZalnFkt9hvUESnZvlNrDMPhSJ08jIvYKhxKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037